import request from "@/util/req";

export function addDD(userid:string,proid:string,num=1){
    return request.post<any,{code:number,message:string}>('cart/add',{
        userid,
        proid,
        num
    })
}

export function getGouwuData(token:string,userid:string){
    return request.post('cart/list',{
        token,
        userid
    })
}

export function removeDanData(cartid:string){
    return request.post('cart/remove',{
        cartid
    })
}

export function updateData(cartid:string,num:number){
    return request.post('cart/updatenum',{
        cartid,
        num
    })
}

export function updateFlag(cartid:string,flag:boolean){
    return request.post('cart/selectone',{
        cartid,flag
    })
}

export function updateFlagAll(userid:string,type:boolean){
    return request.post('cart/selectall',{
        userid,
        type
    })
}

export function removeAll(userid:string){
    return request.post('cart/removeall',{
        userid
    })
}